package com.hspedu.extends_.exercise;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/21
 * @time 17:47
 */
public class ExtendsExercise03 {
    public static void main(String[] args) {
        PC pc = new PC();
        pc.brand = "lenovo";
        pc.CPU = "AMD";
        pc.disk = "sumsung";
        pc.RAM = "JD";
        NotePad notePad = new NotePad();
        notePad.color = "yellow";
        notePad.CPU = "AMD";
        notePad.disk = "sumsung";
        notePad.RAM = "JD";
        System.out.println(pc.getDetails());
        System.out.println(notePad.getDetails());
    }
}

class Computer{
    String CPU;
    String RAM;
    String disk;

    public String getDetails(){
        return CPU+" "+RAM+" "+disk;
    }
}

class PC extends Computer{
    String brand;
}

class NotePad extends Computer{
    String color;
}




